
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <title>ScrollView With Scrollbar Indicator</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

        <style>
            /* Avoid resource latency for these, since they hide unenhanced content */
            .yui3-js-enabled .yui3-scrollview-loading {
                visibility:hidden;
            }

            #additional-content {
                display:none;
            }
        </style>

        <link rel="stylesheet" href="../../build/cssreset/reset-min.css" type="text/css" charset="utf-8">

        <link rel="stylesheet" href="assets/vertical.css" type="text/css" charset="utf-8">
        <link media="handheld, only screen and (max-device-width: 480px)" href="assets/vertical-smallscreen.css" type="text/css" rel="stylesheet" charset="utf-8">

        <script src="../../build/yui/yui-min.js" type="text/javascript" charset="utf-8"></script>
    </head>

    <body class="yui3-skin-sam">

        <div id="scrollview-container">
            <div id="scrollview-header">
                <h1>ScrollView</h1>
            </div>
            <div id="scrollview-content" class="yui3-scrollview-loading">
                <ul> 
                    <li><a href="http://www.acdc.com/" title="AC/DC | The Official AC/DC Site">AC/DC</a></li> 
                    <li><a href="http://www.aerosmith.com/" title="Aerosmith | Aerosmith -">Aerosmith</a></li> 
                    <li><a href="http://www.billyjoel.com/" title="Billy Joel | The Official Billy Joel Site">Billy Joel</a></li> 
                    <li><a href="http://www.bobdylan.com/" title="Home Page | Bob Dylan">Bob Dylan</a></li> 
                    <li><a href="http://www.bobseger.com/" title="Bob Seger | Official Site | Home">Bob Seger</a></li> 
                    <li><a href="http://www.bonjovi.com/" title="Bon Jovi &#134; The Official Website">Bon Jovi</a></li> 
                    <li><a href="http://www.brucespringsteen.net/" title="BRUCE SPRINGSTEEN IS AWESOME">Bruce Springsteen</a></li> 
                    <li><a href="http://www.creed.com/" title="Creed.com – The Official Website of Creed">Creed</a></li> 
                    <li><a href="http://en.wikipedia.org/wiki/Creedence_Clearwater_Revival" title="Creedence Clearwater Revival - Wikipedia, the free encyclopedia">Creedence Clearwater Revival</a></li> 
                    <li><a href="http://www.davematthewsband.com/" title="DAVE MATTHEWS BAND | Home Page | Dave Matthews Band">Dave Matthews Band</a></li> 
                    <li><a href="http://www.defleppard.com/news/" title="DefLeppard.com | the official Def Leppard web site">Def Leppard</a></li> 
                    <li><a href="http://www.eaglesband.com/" title="Eagles | eaglesband.com">The Eagles</a></li>
					<li><a href="http://www.bunnymen.com/" title="Echo &amp; The Bunnymen">Echo and the Bunnymen</a></li>
                    <li><a href="http://www.eminem.com/" title="Eminem : Official Site">Eminem</a></li> 
                    <li><a href="http://www.fleetwoodmac.com/" title="Fleetwood Mac">Fleetwood Mac</a></li> 
                    <li>Green Day</li> 
                    <li><a href="http://www.gunsnroses.com/" title="Guns N' Roses: Home: Chinese Democracy">Guns N' Roses</a></li> 
                    <li><a href="http://www.jamestaylor.com/" title="James Taylor: The Official Site">James Taylor</a></li> 
                    <li><a href="http://www.jay-z.com/index.php" title="Jay-Z.com: The Official Jay-Z Website">Jay-Z</a></li> 
                    <li><a href="http://en.wikipedia.org/wiki/Jimi_Hendrix" title="Jimi Hendrix - Wikipedia, the free encyclopedia">Jimi Hendrix</a></li> 
                    <li><a href="http://www.ledzeppelin.com/" title="Led Zeppelin - Official Website">Led Zeppelin</a></li> 
                    <li><a href="http://www.lynyrdskynyrd.com/" title="Lynyrd Skynyrd">Lynyrd Skynyrd</a></li> 
                    <li><a href="http://metallica.com/" title="Metallica.com">Metallica</a></li> 
                    <li>Motley Crue</li> 
                    <li><a href="http://www.neildiamond.com/" title="Official site from Neil Diamond">Neil Diamond</a></li> 
                    <li><a href="http://en.wikipedia.org/wiki/Nirvana_(band)" title="Nirvana (band) - Wikipedia, the free encyclopedia">Nirvana</a></li> 
                    <li><a href="http://www.ozzy.com/" title="Ozzy Osbourne | The Official Ozzy Osbourne Site">Ozzy Osbourne</a></li> 
                    <li><a href="http://pearljam.com/" title="Home | Pearl Jam - Ten Club">Pearl Jam</a></li> 
                    <li><a href="http://www.pinkfloyd.com/" title="Pink Floyd | The Official Site">Pink Floyd</a></li> 
                    <li><a href="http://www.queenonline.com/" title="Queen Online.com">Queen</a></li> 
                    <li><a href="http://www.rodstewart.com/" title="Rod Stewart | The Official Rod Stewart Site">Rod Stewart</a></li> 
                    <li><a href="http://www.rush.com/" title="RUSH - Official Website">Rush</a></li> 
                    <li><a href="http://www.santana.com/" title="SANTANA - The Official Carlos Santana Web Site">Santana</a></li> 
                    <li><a href="http://www.simonandgarfunkel.com/" title="Simon &amp; Garfunkel official site">Simon and Garfunkel</a></li> 
                    <li><a href="http://www.stevemillerband.com/" title="Steve Miller Band - Official Web Site">Steve Miller Band</a></li> 
                    <li><a href="http://www.thebeatles.com/" title="The Beatles">The Beatles</a></li> 
                    <li><a href="http://www.thedoors.com/" title="The Doors">The Doors</a></li> 
                    <li><a href="http://www.thepolicefile.com/" title="ThePoliceFile.com: The Police - Concert Tickets - World Tour - The Police">The Police</a></li> 
                    <li><a href="http://www.rollingstones.com/" title="The Official site of the Rolling Stones | Rollingstones.com">The Rolling Stones</a></li> 
                    <li><a href="http://www.tompetty.com/" title="TomPetty.com &gt; Home">Tom Petty</a></li> 
                    <li><a href="http://www.u2.com/" title="U2 &gt; Welcome">U2</a></li> 
                    <li><a href="http://www.van-halen.com/" title="Van-Halen.com | the official Van Halen web site">Van Halen</a></li> 
                    <li><a href="http://www.willienelson.com/" title="Home &raquo; 
                    			Willie Nelson">Willie Nelson</a></li> 
                    <li><a href="http://www.zztop.com/" title="ZZ Top | Home">ZZ Top</a></li> 
                </ul>
            </div>
        </div>

        <div id="additional-content">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras aliquam hendrerit elit id vulputate. Pellentesque pellentesque erat rutrum velit facilisis sodales convallis tellus lacinia. Curabitur gravida mi sit amet nulla suscipit sed congue dolor volutpat. Aenean sem tortor, pretium et euismod in, imperdiet sit amet urna. Ut ante nisi, auctor mattis suscipit a, ullamcorper eget leo. Phasellus sagittis ante at lectus rutrum ut sollicitudin sem malesuada. Duis ultrices sapien et nulla tincidunt malesuada. Mauris ante turpis, dignissim eu tincidunt vitae, placerat quis diam. In augue nisl, cursus at rutrum ut, scelerisque et erat. Suspendisse potenti. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris orci dui, aliquam ut convallis ut, dapibus et erat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam erat volutpat. Mauris placerat elit id lectus rhoncus in dignissim justo mollis. Donec nec odio sapien. In iaculis euismod felis non laoreet. Mauris ornare varius neque, et congue erat porta a. Aliquam nec auctor lectus. Etiam ut ipsum a nibh iaculis fringilla.</p>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras aliquam hendrerit elit id vulputate. Pellentesque pellentesque erat rutrum velit facilisis sodales convallis tellus lacinia. Curabitur gravida mi sit amet nulla suscipit sed congue dolor volutpat. Aenean sem tortor, pretium et euismod in, imperdiet sit amet urna. Ut ante nisi, auctor mattis suscipit a, ullamcorper eget leo. Phasellus sagittis ante at lectus rutrum ut sollicitudin sem malesuada. Duis ultrices sapien et nulla tincidunt malesuada. Mauris ante turpis, dignissim eu tincidunt vitae, placerat quis diam. In augue nisl, cursus at rutrum ut, scelerisque et erat. Suspendisse potenti. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris orci dui, aliquam ut convallis ut, dapibus et erat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam erat volutpat. Mauris placerat elit id lectus rhoncus in dignissim justo mollis. Donec nec odio sapien. In iaculis euismod felis non laoreet. Mauris ornare varius neque, et congue erat porta a. Aliquam nec auctor lectus. Etiam ut ipsum a nibh iaculis fringilla.</p>
        </div>

        <script type="text/javascript" charset="utf-8">

            YUI().use('scrollview', function(Y) {

                var scrollView = new Y.ScrollView({
                    id: "scrollview",
                    srcNode: '#scrollview-content',
                    height: 310,
                    flick: {
                        minDistance:10,
                        minVelocity:0.3,
                        axis: "y"
                    }
                });

                scrollView.render();
                
                var content = scrollView.get("contentBox"); 

				content.delegate("click", function(e) {
				    // Prevent links from navigating as part of a scroll gesture
				    if (Math.abs(scrollView.lastScrolledAmt) > 2) {
				        e.preventDefault();
						Y.log("Link behavior suppressed.")
				    }
				}, "a");

                content.delegate("mousedown", function(e) {
                    // Prevent default anchor drag behavior, on browsers which let you drag anchors to the desktop
                    e.preventDefault();
                }, "a");
            });

        </script>
    </body>
</html>
